#include <stdio.h>
#include <stdlib.h>
void insertsortbyhalf(int *data,int n){
    int ls;
    int i,j,low,height,mid;
    for(i=1;i<n;i++){
        int sl=data[i];
        low=0;height=i-1;
        while(low<=height){
            mid=(low+height)/2;
            if(sl>data[mid]){
                low=mid+1;
            }
            else{
                height=mid-1;
            }
           
        }
        for(j=i-1;j>height;--j){
            data[j+1]=data[j];
        }
        data[height+1]=sl;
    }
}
